{% extends "::layout.html.twig" %}

{% block title %} Produits - {{ parent() }} {% endblock %}

{% block content %}
    <div class="row">
        <div class="col-xs-12 col-lg-12">
            <div class="block">
                {% if app.user %}
                    <h1>Nous avons trouvé {{ products|length }} produits correspondant à votre profil !</h1>
                {% else %}
                    <h1>Voici les {{ products|length }} produits de notre boutique !</h1>
                {% endif %}
                <hr/>
                {% for p in products %}
                    <div class="product hproduct">
                        <a href="{{ path('y_commerce_global_produit', {'id': p.id}) }}">
                            <img src="{{ '/'~p.getWebPath() }}" class="img-thumbnail" alt="{{ p.name }}" title="{{ p.name }}" />
                            <h3>{{ p.name }}</h3>
                        </a>
                    </div>
                {% endfor %}
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-lg-12">
            <div class="block">
                <h1>Les tendances actuelles</h1>
                <hr/>
                {% for tp in tendanceProducts %}
                    <div class="product hproduct">
                        <a href="{{ path('y_commerce_global_produit', {'id': tp.id}) }}">
                            <img src="{{ '/'~tp.getWebPath() }}" class="img-thumbnail" alt="{{ tp.name }}" title="{{ tp.name }}" />
                            <h3>{{ tp.name }}</h3>
                        </a>
                    </div>
                {% endfor %}
                <div class="clearfix"></div>
            </div>
        </div>
    </div>
{% endblock %}